﻿namespace CgSilverlightDynamicGeometry
{
    using System;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Ink;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;

    public class Drawing
    {
        public Drawing(Canvas canvas)
        {
            Canvas = canvas;
            CoordinateSystem = new CoordinateSystem(this);
            CartesianGrid = new CartesianGrid(this);
        }

        private CoordinateSystem coordinateSystem;

        public CoordinateSystem CoordinateSystem
        {
            get { return coordinateSystem = coordinateSystem ?? new CoordinateSystem(this); }
            set { coordinateSystem = value; }
        }

        private CartesianGrid cartesianGrid;

        public CartesianGrid CartesianGrid
        {
            get { return cartesianGrid = cartesianGrid ?? new CartesianGrid(this); }
            set { cartesianGrid = value; }
        }


        private Canvas mCanvas;
        /// <summary>
        /// 主画布
        /// </summary>
        public Canvas Canvas
        {
            get { return mCanvas; }
            set { mCanvas = value; }
        }

    }
}
